﻿using System;
using OAuth;
using Darren.Common.Helper;

public partial class _Default : System.Web.UI.Page
{

    protected void Page_Load(object sender, EventArgs e)
    {


    }
    protected void btnSinaLogin_Click(object sender, EventArgs e)
    {
        SinaOAuth auth = new SinaOAuth();

        AccessToken token = new AccessToken();
        string url = auth.Login(out token, "http://localhost:32768/localback.aspx");
        CookieHelper.SetCookie("SinaOAuth", string.Format("Token={0}&TokenSecret={1}", token.Token, token.TokenSecret));

        Response.Redirect(url);
    }

    protected void btn163Login_Click(object sender, EventArgs e)
    {
        NetEasyOAuth auth = new NetEasyOAuth();
        AccessToken token = new AccessToken();
        string url = auth.Login(out token, NetEasyOAuth.CallBackURL);
        //Session["oauth_token"] = token.Token;
        //Session["oauth_token_secret"] = token.TokenSecret;
        CookieHelper.SetCookie("NetEasyOAuth", string.Format("Token={0}&TokenSecret={1}", token.Token, token.TokenSecret));
        Response.Redirect(url);
    }
    protected void btnQQLogin_Click(object sender, EventArgs e)
    {
        QQOAuth auth = new QQOAuth();

        AccessToken token = new AccessToken();
        string url = auth.Login(out token, "http://www.sz-zf.com/localback.aspx");

        CookieHelper.SetCookie("QQOAuth", string.Format("Token={0}&TokenSecret={1}", token.Token, token.TokenSecret));
        Response.Redirect(url);
    }
}
